//
//  UILable+Extention.swift
//  JJWeibo
//
//  Created by JJ on 15/9/6.
//  Copyright © 2015年 JJ. All rights reserved.
//

import UIKit

extension UILabel{
    
    convenience init(title: String?,color: UIColor,fontsize: CGFloat,layoutWidth:CGFloat = 0){
        
        self.init()
        
        text=title
        
        textColor=color
        
        font=UIFont.systemFontOfSize(fontsize)
        
        if layoutWidth > 0{
            
            preferredMaxLayoutWidth=layoutWidth
            numberOfLines=0
        }
        
        sizeToFit()
    }
}